Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Functions / Obtaining Information About an Endpoint


OTGetEndpointState

Obtains the current state of an endpoint.

C INTERFACE
OTResult OTGetEndpointState(EndpointRef ref);
C++ INTERFACE
OTResult TEndpoint::GetEndpointState();
PARAMETERS
ref
The endpoint reference of the endpoint whose state you want to determine.
DESCRIPTION
The OTGetEndpointState function returns an integer greater than or equal to 0 indicating the state of the specified endpoint. The endpoint state enumeration describes possible endpoint states and lists their decimal value.

If the function fails, it returns a negative integer specifying the error code. You must open an endpoint before you can determine its state.

You might need to know an endpoint's state in order to determine whether a function has completed or whether the endpoint is in an appropriate state for the function that you want to call next.

This function returns endpoint state information immediately, whether the endpoint is in synchronous or asynchronous mode.

VALID STATES
All

SEE ALSO
For general information about the services provided by an endpoint and the size of buffers it can use, use the OTGetEndpointInfo function (page 3-82).

The section "Endpoint States," beginning on page 3-13 explains how you use a knowledge of an endpoint's state to manage endpoints.

The endpoint state enumeration (page 3-46), describes possible endpoint states and lists their decimal value.

Use the OTOpenEndpoint function (page 3-74) or the OTAsyncOpenEndpoint function (page 3-76) to open an endpoint.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996